/*
 * ModelViewer.h
 *
 *  Created on: 09/05/2013
 *      Author: gabriel
 */

#ifndef MODELVIEWER_H_
#define MODELVIEWER_H_


#ifdef MacOSX
#include "GLee.h"
#include <GLUT/glut.h>
#else
#include "GLee.h"
#include <GL/glut.h>
#endif


#include <iostream>
#include "objLoader.h"
#include "shader.h"
#include "tgaimage.h"

typedef struct {
	float coords[3];
	float normal[3];
	float texCoords[2];
	float ambient[4];
	float diffuse[4];
	float specular[4];
	float emit[4];
	//float shiny;

}Vertex;

class ModelViewer {
public:

	//objLoader *objData;
	int *iCounts;
	Vertex *vertices;

	float *shiny;
	int faceCount;
	int vertexCount;
	//int indexCount;
	int materialCount;
	int textureCount;
	unsigned int vaoHandle;
	unsigned int vertexVboId;
	unsigned int *indexVboId;
	unsigned int *textureVboId;


public:
	ModelViewer();
	virtual ~ModelViewer();
	unsigned int loadTexture(std::string filename);
	bool load(std::string fileName, Shader *program);
	void render(Shader *program);

};

#endif /* MODELVIEWER_H_ */
